package cn.imnaer.service.rest.view.model;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import cn.imnaer.service.persistence.model.City;
import cn.imnaer.service.persistence.model.User;

public class UserView {
		private String userId;
		private String name;
		private String mobile;
		private String email;
		private String gender;
		private String birthday;
		private String introduction;
		private String cityCode;
		private String  cityName;
		private String  stateCode;
		private String  stateName;
		private String  school;
		private String company;
		private  List<RecommendView>   contributionScenics=new ArrayList<>();//用户贡献的景点
		public String getSchool() {
			return school;
		}
		public void setSchool(String school) {
			this.school = school;
		}

		public String getCompany() {
			return company;
		}

		public void setCompany(String company) {
			this.company = company;
		}
		public String getUserId() {
			return userId;
		}

		public void setUserId(String userId) {
			this.userId = userId;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getMobile() {
			return mobile;
		}

		public void setMobile(String mobile) {
			this.mobile = mobile;
		}

	
		public String getGender() {
			return gender;
		}

		public void setGender(String gender) {
			this.gender = gender;
		}

		public String getBirthday() {
			return birthday;
		}

		public void setBirthday(String birthday) {
			this.birthday = birthday;
		}

		public String getEmail() {
			return email;
		}

		public void setEmail(String email) {
			this.email = email;
		}
		public String getIntroduction() {
			return introduction;
		}

		public void setIntroduction(String introduction) {
			this.introduction = introduction;
		}
		public String getCityCode() {
			return cityCode;
		}

		public void setCityCode(String cityCode) {
			this.cityCode = cityCode;
		}

		public String getCityName() {
			return cityName;
		}

		public void setCityName(String cityName) {
			this.cityName = cityName;
		}

		public String getStateCode() {
			return stateCode;
		}

		public void setStateCode(String stateCode) {
			this.stateCode = stateCode;
		}

		public String getStateName() {
			return stateName;
		}

		public void setStateName(String stateName) {
			this.stateName = stateName;
		}
		public List<RecommendView> getContributionScenics() {
			return contributionScenics;
		}
		public void setContributionScenics(List<RecommendView> contributionScenics) {
			this.contributionScenics = contributionScenics;
		}
  public  static  UserView valueOf(User user){
	  UserView  userView=new UserView();
	  BeanUtils.copyProperties(user, userView);
	City  city =user.getCity();
	  userView.setCityCode(city.getCityCode());
	  userView.setCityName(city.getCityName());
	  userView.setStateCode(city.getStateCode());
	  userView.setStateName(city.getStateName());
	  return userView;
  }
}
